package main

import "fmt"

type student struct {
	id   int
	name string
	age  int
}

func main() {
	stu := student{101, "zhangsan", 12}
	var p *student
	p = &stu
	fmt.Println(*p)
	fmt.Println((*p).id)
	fmt.Println(p.age)
	p.age = 20
	fmt.Println(p.age)
	update(p)
	fmt.Println(p)

}
func update(p *student) {
	p.age = 30
}
